package com.eascs.crm.web.controller;

import javax.inject.Inject;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.eascs.app.dao.PageResult;
import com.eascs.crm.common.entity.CustomerBasicInfoEntity;
import com.eascs.crm.common.vo.QueryCustomerVO;
import com.eascs.crm.web.service.LocalCustomerInfoServiceImpl;
import com.eascs.site.controller.BaseRestController;
import com.eascs.site.view.BaseRestResult;

@RestController
@RequestMapping("/customer/customerRest")
public class CustomerRestController extends BaseRestController {


	@Inject
	LocalCustomerInfoServiceImpl customerInfoService;

	@RequestMapping(value = "/getCustomerData")
	public BaseRestResult<PageResult<CustomerBasicInfoEntity>> getCustomerData(int pageSize ,int showPage,String customer_name,String mobile ) {
		QueryCustomerVO vo =new QueryCustomerVO ();
		vo.setShowPage(showPage);
		vo.setPageSize(pageSize);
		vo.setCustomer_name(customer_name);
		vo.setMobile(mobile);
		PageResult<CustomerBasicInfoEntity>  page=customerInfoService.findCustomerBaseInfo(vo);
		return BaseRestResult.buildRestResult(page);
	}
	
}